package com.myspring.controller;

import com.myspring.entity.Category;
import com.myspring.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping(value = {"/mycontroller6"})
public class MyController6 {
    @Autowired
    private MyService myService;

    @RequestMapping(value = "/mymethod6/")
    public ResponseEntity<List<Category>> mymethod6() throws  Exception{
        return  new ResponseEntity<List<Category>>(myService.queryAllCate(), HttpStatus.OK);
    }
}
